﻿create PROCEDURE Sync.SP_Board_SelectChanges
@LastRowVersion rowversion,
@FilterdColumn UNIQUEIDENTIFIER
AS 
BEGIN 
	SELECT 
        t.[BoardID],
		g.[BoardNumber],g.[CommitteeID],g.[BoardDate],
		t.IsDeleted,
		t.LastUpdatedDate
	FROM [dbo].[Board] g RIGHT JOIN Sync.Board_Tracking t  
    ON t.BoardID = g.BoardID 
	WHERE (@LastRowVersion IS NULL OR t.Version > @LastRowVersion)
        AND (@FilterdColumn IS NULL OR g.CommitteeID = @FilterdColumn)
    END














